export class AIConfig{
    static SkyImageSvUrl = "http://10.10.20.21:7860/sdapi/v1/txt2img";
    static TiledImageSvUrl = "http://10.10.20.21:7860/sdapi/v1/txt2img";
    //static i2iSvUrl = 'http://10.10.20.21:7860/sdapi/v1/img2img'
    static i2iSvUrl = 'http://111.22.161.118:3002/sdapi/v1/img2img'
    //static ImageSvUrl = "http://10.10.20.21:7860/sdapi/v1/txt2img";
    static ImageSvUrl = 'http://111.22.161.118:3002/sdapi/v1/txt2img';
    //static ProfessionalChatSvUrl = "http://49.51.73.156:3000/chat"
    //static ProfessionalChatSvUrl = "http://49.51.73.156:3000/chat"
    //static cmdParserUrl = 'http://10.10.20.21:3000/cmdparser'
    static cmdParserUrl = 'http://111.22.161.118:3001/cmdparser'
    //static cmdParseLogUrl = 'http://10.10.20.21:3002/cmdparser'
    static cmdParseLogUrl = 'http://111.22.161.118:3001/cmdlog'
    //static cmdParserUrl = 'http://10.10.20.21:7860/cmdparser'
    static assetsLibUrl = 'http://10.10.20.21:8000/assetslib'
    static AudioSvUrl = "http://111.22.161.118:4000/items";
    static AudioDownSvUrl = "http://111.22.161.118:3001/";
    static layaApi = "http://124.221.152.21:8089";
    static TreeDataSvUrl = 'http://111.22.161.118:3001/treeranddata';
    static imageStorage: string = "https://layame-temporary-1251285021.cos.ap-shanghai.myqcloud.com/";
    static TTSServerUrl = 'http://111.22.161.118:3001/say';//'http://10.10.20.21:7860/say';
    static TTS_ValleX_Url = 'http://111.22.161.118:3001/tts_vallex'
    static TTS_ValleX_UrlTest = 'http://10.10.20.21:6011/tts'
    static TTS_Vallex_PromptUploadUrl = 'http://111.22.161.118:3001/tts_uploadprompt'
    static TTS_Vallex_PromptUploadUrlTest = 'http://10.10.20.21:6011/uploadprompt'
    static QAServerUrl='http://111.22.161.118:3000/items';
    
    //static MusicGenUploadUrl = 'http://10.10.20.21:4000/uploadfile';
    static MusicGenUploadUrl = 'http://111.22.161.118:4000/uploadfile';
    static MusicGenTestUrl = 'http://10.10.20.21:4000/items/';
    //static MusicRefUploadSvUrl = 'http://10.10.20.21:7000/uploadfile'
}

//TEST
//AIConfig.TTS_ValleX_Url = AIConfig.TTS_ValleX_UrlTest
//AIConfig.TTS_Vallex_PromptUploadUrl = AIConfig.TTS_Vallex_PromptUploadUrlTest

export class LayaAPIAction {
    // 生成背景音乐
    static generate_music = "generate_music";
    // 生成天空盒
    static generate_skybox = "generate_skybox";
    // 文字生成图片
    static text_to_image = "text_to_image";
    // 图片生成图片
    static image_to_image = "image_to_image";
    // 指令解析
    static cmdparser = "cmdparser";
    // OpenAI文字聊天
    static chatgpt = "chatgpt";
    // 生百度文心一言文字聊天
    static ernieBot = "ernie-bot";
    // 翻译（中文翻译成英文）
    static translation = "translation";
}

// 错误码
export enum LayaAPICode {
    // 成功
    CodeSuccess,
    // 收到消息的 JSON 解码失败
    CodeUnmarshalError,
    // 收到的参数不全
    CodeIncompleteParam,
    // 收到的请求中包含未知的 action
    CodeUnknownAction,
    // 生成 task id 失败
    CodeGenerateTaskIdFail,
    // 数据不存在
    CodeNotFound,
    // 失败
    CodeFail
}

// 任务状态编码
export enum LayaAPIStatus {
    // 任务已完成初始化
    TaskStatusInit,
    // 任务运行中
    TaskStatusRunning,
    // 任务后续状态待定
    TaskStatusPending,
    // 任务在排队中
    TaskStatusWaiting,
    // 任务需要的服务被用户的其他任务占用了，这个任务正在等待占用的任务完成
    TaskStatusCccupied,
    // 任务已经完成,TaskStatusDone 之后的状态，都说明任务已经结束。
    TaskStatusDone,
    // 参数错误
    TaskStatusParamError,
    // 个人任务队列已满，不能再提交新任务
    TaskStatusIsFull,
    // 任务请求编码失败
    TaskStatusEncodeFail,
    // 投递任务请求失败
    TaskStatusDeliveryFail,
    // 服务进度查询失败
    TaskStatusQueryResultFail,
    // 服务回馈解码失败
    TaskStatusUnmarshalFail,
    // 任务请求内容过长
    TaskStatusTooLong,
    TaskStatusNeedUsageCount=13,                        // 没有订阅点数了
    TaskStatusSubscriptionExpired=14,                   // The subscription has expired
    // 任务执行超时
    TaskStatusTimeout = 100,
}
